﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetProvinciasByDepartamentoID')
	BEGIN
		PRINT 'DROP  Procedure  GetProvinciasByDepartamentoID'
		DROP  Procedure  GetProvinciasByDepartamentoID
	END
GO

PRINT 'CREATE Procedure GetProvinciasByDepartamentoID'
GO

CREATE Procedure GetProvinciasByDepartamentoID

	(
		@intDepartamentoID int
	)

AS

	SELECT DISTINCT(IdProvincia), Provincia FROM UBIGEO WHERE IdDepartamento = @intDepartamentoID

GO


GRANT EXEC ON GetProvinciasByDepartamentoID TO PUBLIC

GO


